3.9.40 \(\int \frac {(A+B x) \sqrt {a+b x+c x^2}}{x} \, dx\)

Optimal. Leaf size=129 \[ -\frac {\left (-4 a B c-4 A b c+b^2 B\right ) \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{8 c^{3/2}}+\frac {\sqrt {a+b x+c x^2} (4 A c+b B+2 B c x)}{4 c}-\sqrt {a} A \tanh ^{-1}\left (\frac {2 a+b x}{2 \sqrt {a} \sqrt {a+b x+c x^2}}\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 129, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {814, 843, 621, 206, 724} \begin {gather*} -\frac {\left (-4 a B c-4 A b c+b^2 B\right ) \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{8 c^{3/2}}+\frac {\sqrt {a+b x+c x^2} (4 A c+b B+2 B c x)}{4 c}-\sqrt {a} A \tanh ^{-1}\left (\frac {2 a+b x}{2 \sqrt {a} \sqrt {a+b x+c x^2}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((A + B*x)*Sqrt[a + b*x + c*x^2])/x,x]

[Out]

((b*B + 4*A*c + 2*B*c*x)*Sqrt[a + b*x + c*x^2])/(4*c) - Sqrt[a]*A*ArcTanh[(2*a + b*x)/(2*Sqrt[a]*Sqrt[a + b*x
+ c*x^2])] - ((b^2*B - 4*A*b*c - 4*a*B*c)*ArcTanh[(b + 2*c*x)/(2*Sqrt[c]*Sqrt[a + b*x + c*x^2])])/(8*c^(3/2))

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 621

Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(4*c - x^2), x], x, (b + 2*c*x)
/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 724

Int[1/(((d_.) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Symbol] :> Dist[-2, Subst[Int[1/(4*c*d
^2 - 4*b*d*e + 4*a*e^2 - x^2), x], x, (2*a*e - b*d - (2*c*d - b*e)*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a,
b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[2*c*d - b*e, 0]

Rule 814

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Sim
p[((d + e*x)^(m + 1)*(c*e*f*(m + 2*p + 2) - g*(c*d + 2*c*d*p - b*e*p) + g*c*e*(m + 2*p + 1)*x)*(a + b*x + c*x^
2)^p)/(c*e^2*(m + 2*p + 1)*(m + 2*p + 2)), x] - Dist[p/(c*e^2*(m + 2*p + 1)*(m + 2*p + 2)), Int[(d + e*x)^m*(a
 + b*x + c*x^2)^(p - 1)*Simp[c*e*f*(b*d - 2*a*e)*(m + 2*p + 2) + g*(a*e*(b*e - 2*c*d*m + b*e*m) + b*d*(b*e*p -
 c*d - 2*c*d*p)) + (c*e*f*(2*c*d - b*e)*(m + 2*p + 2) + g*(b^2*e^2*(p + m + 1) - 2*c^2*d^2*(1 + 2*p) - c*e*(b*
d*(m - 2*p) + 2*a*e*(m + 2*p + 1))))*x, x], x], x] /; FreeQ[{a, b, c, d, e, f, g, m}, x] && NeQ[b^2 - 4*a*c, 0
] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && GtQ[p, 0] && (IntegerQ[p] ||  !RationalQ[m] || (GeQ[m, -1] && LtQ[m, 0])
) &&  !ILtQ[m + 2*p, 0] && (IntegerQ[m] || IntegerQ[p] || IntegersQ[2*m, 2*p])

Rule 843

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Dis
t[g/e, Int[(d + e*x)^(m + 1)*(a + b*x + c*x^2)^p, x], x] + Dist[(e*f - d*g)/e, Int[(d + e*x)^m*(a + b*x + c*x^
2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0]
&&  !IGtQ[m, 0]

Rubi steps

\begin {align*} \int \frac {(A+B x) \sqrt {a+b x+c x^2}}{x} \, dx &=\frac {(b B+4 A c+2 B c x) \sqrt {a+b x+c x^2}}{4 c}-\frac {\int \frac {-4 a A c+\frac {1}{2} \left (b^2 B-4 A b c-4 a B c\right ) x}{x \sqrt {a+b x+c x^2}} \, dx}{4 c}\\ &=\frac {(b B+4 A c+2 B c x) \sqrt {a+b x+c x^2}}{4 c}+(a A) \int \frac {1}{x \sqrt {a+b x+c x^2}} \, dx-\frac {\left (b^2 B-4 A b c-4 a B c\right ) \int \frac {1}{\sqrt {a+b x+c x^2}} \, dx}{8 c}\\ &=\frac {(b B+4 A c+2 B c x) \sqrt {a+b x+c x^2}}{4 c}-(2 a A) \operatorname {Subst}\left (\int \frac {1}{4 a-x^2} \, dx,x,\frac {2 a+b x}{\sqrt {a+b x+c x^2}}\right )-\frac {\left (b^2 B-4 A b c-4 a B c\right ) \operatorname {Subst}\left (\int \frac {1}{4 c-x^2} \, dx,x,\frac {b+2 c x}{\sqrt {a+b x+c x^2}}\right )}{4 c}\\ &=\frac {(b B+4 A c+2 B c x) \sqrt {a+b x+c x^2}}{4 c}-\sqrt {a} A \tanh ^{-1}\left (\frac {2 a+b x}{2 \sqrt {a} \sqrt {a+b x+c x^2}}\right )-\frac {\left (b^2 B-4 A b c-4 a B c\right ) \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{8 c^{3/2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.17, size = 127, normalized size = 0.98 \begin {gather*} \frac {\left (4 a B c+4 A b c+b^2 (-B)\right ) \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+x (b+c x)}}\right )}{8 c^{3/2}}+\frac {\sqrt {a+x (b+c x)} (4 A c+b B+2 B c x)}{4 c}-\sqrt {a} A \tanh ^{-1}\left (\frac {2 a+b x}{2 \sqrt {a} \sqrt {a+x (b+c x)}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((A + B*x)*Sqrt[a + b*x + c*x^2])/x,x]

[Out]

((b*B + 4*A*c + 2*B*c*x)*Sqrt[a + x*(b + c*x)])/(4*c) - Sqrt[a]*A*ArcTanh[(2*a + b*x)/(2*Sqrt[a]*Sqrt[a + x*(b
 + c*x)])] + ((-(b^2*B) + 4*A*b*c + 4*a*B*c)*ArcTanh[(b + 2*c*x)/(2*Sqrt[c]*Sqrt[a + x*(b + c*x)])])/(8*c^(3/2
))

________________________________________________________________________________________

IntegrateAlgebraic [A]  time = 0.57, size = 135, normalized size = 1.05 \begin {gather*} \frac {\left (-4 a B c-4 A b c+b^2 B\right ) \log \left (-2 c^{3/2} \sqrt {a+b x+c x^2}+b c+2 c^2 x\right )}{8 c^{3/2}}+\frac {\sqrt {a+b x+c x^2} (4 A c+b B+2 B c x)}{4 c}+2 \sqrt {a} A \tanh ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a}}-\frac {\sqrt {a+b x+c x^2}}{\sqrt {a}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

IntegrateAlgebraic[((A + B*x)*Sqrt[a + b*x + c*x^2])/x,x]

[Out]

((b*B + 4*A*c + 2*B*c*x)*Sqrt[a + b*x + c*x^2])/(4*c) + 2*Sqrt[a]*A*ArcTanh[(Sqrt[c]*x)/Sqrt[a] - Sqrt[a + b*x
 + c*x^2]/Sqrt[a]] + ((b^2*B - 4*A*b*c - 4*a*B*c)*Log[b*c + 2*c^2*x - 2*c^(3/2)*Sqrt[a + b*x + c*x^2]])/(8*c^(
3/2))

________________________________________________________________________________________

fricas [A]  time = 1.41, size = 651, normalized size = 5.05 \begin {gather*} \left [\frac {8 \, A \sqrt {a} c^{2} \log \left (-\frac {8 \, a b x + {\left (b^{2} + 4 \, a c\right )} x^{2} - 4 \, \sqrt {c x^{2} + b x + a} {\left (b x + 2 \, a\right )} \sqrt {a} + 8 \, a^{2}}{x^{2}}\right ) - {\left (B b^{2} - 4 \, {\left (B a + A b\right )} c\right )} \sqrt {c} \log \left (-8 \, c^{2} x^{2} - 8 \, b c x - b^{2} - 4 \, \sqrt {c x^{2} + b x + a} {\left (2 \, c x + b\right )} \sqrt {c} - 4 \, a c\right ) + 4 \, {\left (2 \, B c^{2} x + B b c + 4 \, A c^{2}\right )} \sqrt {c x^{2} + b x + a}}{16 \, c^{2}}, \frac {4 \, A \sqrt {a} c^{2} \log \left (-\frac {8 \, a b x + {\left (b^{2} + 4 \, a c\right )} x^{2} - 4 \, \sqrt {c x^{2} + b x + a} {\left (b x + 2 \, a\right )} \sqrt {a} + 8 \, a^{2}}{x^{2}}\right ) + {\left (B b^{2} - 4 \, {\left (B a + A b\right )} c\right )} \sqrt {-c} \arctan \left (\frac {\sqrt {c x^{2} + b x + a} {\left (2 \, c x + b\right )} \sqrt {-c}}{2 \, {\left (c^{2} x^{2} + b c x + a c\right )}}\right ) + 2 \, {\left (2 \, B c^{2} x + B b c + 4 \, A c^{2}\right )} \sqrt {c x^{2} + b x + a}}{8 \, c^{2}}, \frac {16 \, A \sqrt {-a} c^{2} \arctan \left (\frac {\sqrt {c x^{2} + b x + a} {\left (b x + 2 \, a\right )} \sqrt {-a}}{2 \, {\left (a c x^{2} + a b x + a^{2}\right )}}\right ) - {\left (B b^{2} - 4 \, {\left (B a + A b\right )} c\right )} \sqrt {c} \log \left (-8 \, c^{2} x^{2} - 8 \, b c x - b^{2} - 4 \, \sqrt {c x^{2} + b x + a} {\left (2 \, c x + b\right )} \sqrt {c} - 4 \, a c\right ) + 4 \, {\left (2 \, B c^{2} x + B b c + 4 \, A c^{2}\right )} \sqrt {c x^{2} + b x + a}}{16 \, c^{2}}, \frac {8 \, A \sqrt {-a} c^{2} \arctan \left (\frac {\sqrt {c x^{2} + b x + a} {\left (b x + 2 \, a\right )} \sqrt {-a}}{2 \, {\left (a c x^{2} + a b x + a^{2}\right )}}\right ) + {\left (B b^{2} - 4 \, {\left (B a + A b\right )} c\right )} \sqrt {-c} \arctan \left (\frac {\sqrt {c x^{2} + b x + a} {\left (2 \, c x + b\right )} \sqrt {-c}}{2 \, {\left (c^{2} x^{2} + b c x + a c\right )}}\right ) + 2 \, {\left (2 \, B c^{2} x + B b c + 4 \, A c^{2}\right )} \sqrt {c x^{2} + b x + a}}{8 \, c^{2}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x^2+b*x+a)^(1/2)/x,x, algorithm="fricas")

[Out]

[1/16*(8*A*sqrt(a)*c^2*log(-(8*a*b*x + (b^2 + 4*a*c)*x^2 - 4*sqrt(c*x^2 + b*x + a)*(b*x + 2*a)*sqrt(a) + 8*a^2
)/x^2) - (B*b^2 - 4*(B*a + A*b)*c)*sqrt(c)*log(-8*c^2*x^2 - 8*b*c*x - b^2 - 4*sqrt(c*x^2 + b*x + a)*(2*c*x + b
)*sqrt(c) - 4*a*c) + 4*(2*B*c^2*x + B*b*c + 4*A*c^2)*sqrt(c*x^2 + b*x + a))/c^2, 1/8*(4*A*sqrt(a)*c^2*log(-(8*
a*b*x + (b^2 + 4*a*c)*x^2 - 4*sqrt(c*x^2 + b*x + a)*(b*x + 2*a)*sqrt(a) + 8*a^2)/x^2) + (B*b^2 - 4*(B*a + A*b)
*c)*sqrt(-c)*arctan(1/2*sqrt(c*x^2 + b*x + a)*(2*c*x + b)*sqrt(-c)/(c^2*x^2 + b*c*x + a*c)) + 2*(2*B*c^2*x + B
*b*c + 4*A*c^2)*sqrt(c*x^2 + b*x + a))/c^2, 1/16*(16*A*sqrt(-a)*c^2*arctan(1/2*sqrt(c*x^2 + b*x + a)*(b*x + 2*
a)*sqrt(-a)/(a*c*x^2 + a*b*x + a^2)) - (B*b^2 - 4*(B*a + A*b)*c)*sqrt(c)*log(-8*c^2*x^2 - 8*b*c*x - b^2 - 4*sq
rt(c*x^2 + b*x + a)*(2*c*x + b)*sqrt(c) - 4*a*c) + 4*(2*B*c^2*x + B*b*c + 4*A*c^2)*sqrt(c*x^2 + b*x + a))/c^2,
 1/8*(8*A*sqrt(-a)*c^2*arctan(1/2*sqrt(c*x^2 + b*x + a)*(b*x + 2*a)*sqrt(-a)/(a*c*x^2 + a*b*x + a^2)) + (B*b^2
 - 4*(B*a + A*b)*c)*sqrt(-c)*arctan(1/2*sqrt(c*x^2 + b*x + a)*(2*c*x + b)*sqrt(-c)/(c^2*x^2 + b*c*x + a*c)) +
2*(2*B*c^2*x + B*b*c + 4*A*c^2)*sqrt(c*x^2 + b*x + a))/c^2]

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x^2+b*x+a)^(1/2)/x,x, algorithm="giac")

[Out]

Exception raised: TypeError >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,x):;OUTPUT:Warn
ing, replacing 0 by ` u`, a substitution variable should perhaps be purged.Warning, replacing 0 by ` u`, a sub
stitution variable should perhaps be purged.Warning, replacing 0 by ` u`, a substitution variable should perha
ps be purged.index.cc index_m operator + Error: Bad Argument Value

________________________________________________________________________________________

maple [A]  time = 0.06, size = 184, normalized size = 1.43 \begin {gather*} -A \sqrt {a}\, \ln \left (\frac {b x +2 a +2 \sqrt {c \,x^{2}+b x +a}\, \sqrt {a}}{x}\right )+\frac {A b \ln \left (\frac {c x +\frac {b}{2}}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 \sqrt {c}}+\frac {B a \ln \left (\frac {c x +\frac {b}{2}}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{2 \sqrt {c}}-\frac {B \,b^{2} \ln \left (\frac {c x +\frac {b}{2}}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{8 c^{\frac {3}{2}}}+\frac {\sqrt {c \,x^{2}+b x +a}\, B x}{2}+\sqrt {c \,x^{2}+b x +a}\, A +\frac {\sqrt {c \,x^{2}+b x +a}\, B b}{4 c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*x+A)*(c*x^2+b*x+a)^(1/2)/x,x)

[Out]

1/2*B*x*(c*x^2+b*x+a)^(1/2)+1/4*B/c*(c*x^2+b*x+a)^(1/2)*b+1/2*B/c^(1/2)*ln((c*x+1/2*b)/c^(1/2)+(c*x^2+b*x+a)^(
1/2))*a-1/8*B/c^(3/2)*ln((c*x+1/2*b)/c^(1/2)+(c*x^2+b*x+a)^(1/2))*b^2+A*(c*x^2+b*x+a)^(1/2)+1/2*A*b*ln((c*x+1/
2*b)/c^(1/2)+(c*x^2+b*x+a)^(1/2))/c^(1/2)-A*a^(1/2)*ln((2*a+b*x+2*a^(1/2)*(c*x^2+b*x+a)^(1/2))/x)

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x^2+b*x+a)^(1/2)/x,x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a*c-b^2>0)', see `assume?` f
or more details)Is 4*a*c-b^2 positive, negative or zero?

________________________________________________________________________________________

mupad [B]  time = 1.37, size = 146, normalized size = 1.13 \begin {gather*} A\,\sqrt {c\,x^2+b\,x+a}+B\,\left (\frac {x}{2}+\frac {b}{4\,c}\right )\,\sqrt {c\,x^2+b\,x+a}-A\,\sqrt {a}\,\ln \left (\frac {b}{2}+\frac {a}{x}+\frac {\sqrt {a}\,\sqrt {c\,x^2+b\,x+a}}{x}\right )+\frac {A\,b\,\ln \left (\frac {\frac {b}{2}+c\,x}{\sqrt {c}}+\sqrt {c\,x^2+b\,x+a}\right )}{2\,\sqrt {c}}+\frac {B\,\ln \left (\frac {\frac {b}{2}+c\,x}{\sqrt {c}}+\sqrt {c\,x^2+b\,x+a}\right )\,\left (a\,c-\frac {b^2}{4}\right )}{2\,c^{3/2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*x)*(a + b*x + c*x^2)^(1/2))/x,x)

[Out]

A*(a + b*x + c*x^2)^(1/2) + B*(x/2 + b/(4*c))*(a + b*x + c*x^2)^(1/2) - A*a^(1/2)*log(b/2 + a/x + (a^(1/2)*(a
+ b*x + c*x^2)^(1/2))/x) + (A*b*log((b/2 + c*x)/c^(1/2) + (a + b*x + c*x^2)^(1/2)))/(2*c^(1/2)) + (B*log((b/2
+ c*x)/c^(1/2) + (a + b*x + c*x^2)^(1/2))*(a*c - b^2/4))/(2*c^(3/2))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (A + B x\right ) \sqrt {a + b x + c x^{2}}}{x}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x**2+b*x+a)**(1/2)/x,x)

[Out]

Integral((A + B*x)*sqrt(a + b*x + c*x**2)/x, x)

________________________________________________________________________________________